package com.example.easypoi.model;


import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.naming.Name;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @description:
 * @author: 朱超
 * @createDate: 2022/1/3
 * @version: 1.0
 * @remark：备注
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ExcelPoi implements Serializable {
    @Excel(name = "用户编号",width = 10)
    private Long excelId;
    @Excel(name = "用户姓名",width = 20)
//    @NotNull(message = "用户名不能为空哦!!")
    private String excelName;
    @Excel(name = "用户年龄")
    private Integer excelAge;
    @Excel(name = "用户性别 男_1 女_0 保密_2",replace = {"男_1", "女_0","保密_2"}, width = 15, orderNum = "1")
    private Integer  excelSex;
    @Excel(name = "创建时间",exportFormat = "yyyy-MM-dd",importFormat = "yyyy-MM-dd",width = 25, orderNum = "3")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date excelTime;
    @Excel(name = "更新时间",exportFormat = "yyyy-MM-dd",importFormat = "yyyy-MM-dd",width = 25, orderNum = "3")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date updateTime;
    //type类型=1 表示是文件路径 2 是图片 需要在本地静态文件夹下存放
    @Excel(name = "头像", width = 15, height = 10, type = 1, orderNum = "1")
    private String picture;
}
